package com.bestcem.xm.txtanls.controller.param.topic;

import com.bestcem.xm.common.core.constant.RegTypes;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

/**
 * @author liheng
 * @version v2.0
 * @date 2021/8/10 15:02
 */
@Data
public class ListTopicQuery {

    @NotNull(message = "文本分析项目id，不能为空")
    @Pattern(regexp = RegTypes.OBJECT_ID, message = "项目id格式错误")
    @ApiModelProperty(value = "文本分析项目id")
    @JsonProperty(value = "projectid")
    private String projectId;

    @ApiModelProperty(value = "分析的字段id")
    @JsonProperty(value = "field_id")
    private String fieldId;

    @ApiModelProperty(value = "自定义开始时间，yyyy-MM-dd", example = "\"2020-06-03\"")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonProperty(value = "start_time")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "自定义结束时间，yyyy-MM-dd", example = "\"2020-06-03\"")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonProperty(value = "end_time")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "时间间隔类型, day week month quarter year custom", example = "day")
    @NotNull(message = "时间间隔类型不能为空")
    @JsonProperty(value = "dtfiltertype")
    private String filterType;

    @ApiModelProperty(value = "根据时间间隔的开始时间", example = "\"2020-06-03\"")
    @JsonProperty(value = "current")
    private String current;

    /**
     * 是否查询全部数据，0-否，1-true
     */
    @JsonProperty(value = "data_use")
    private Integer dataUse;
}
